package com.example.cloud.alibaba.seata.common.feign;


import com.example.cloud.alibaba.seata.common.dto.AccountDTO;
import com.example.cloud.alibaba.seata.common.feign.fallback.RemoteAccountServiceFallback;
import com.example.cloud.alibaba.seata.common.utils.SimpleMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author: lidong
 * @Description  账户服务接口
 * @Date Created in 2019/9/5 16:37
 */
@FeignClient(value = "account-example", contextId = "accountServiceClient",fallbackFactory = RemoteAccountServiceFallback.class)
public interface IAccountService {

    /**
     * 从账户扣钱
     */
    @PostMapping("/account/dec_account")
    SimpleMessage decreaseAccount(@RequestBody AccountDTO accountDTO);

    @GetMapping("/account/test/{path}")
    SimpleMessage testAccount(@PathVariable("path") String path);
}
